package com.aoxin.util.enumerate;

import com.aoxin.util.ErrorUtil;

/**
 * 奖励类型
 * 
 * @author Melody
 * @date 2018年4月28日 下午6:02:17
 */
public enum HortationYtpe {
	LFB(1, "立方币"), ENTITY(2, "实物");
	private int id;

	private String value;

	private HortationYtpe(int id, String value) {
		this.id = id;
		this.value = value;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public static HortationYtpe fromId(int id) {
		switch (id) {
		case 1:
			return LFB;
		case 2:
			return ENTITY;
		}
		throw new RuntimeException(String.format(ErrorUtil.OPERATE_TYPE, id));
	}
}
